\usepackage{listings}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{hyperref}
\usepackage{color}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{titlesec}
\usepackage{float}
\usepackage[left=3cm, right=3cm, top=3cm, bottom=3cm]{geometry}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\lstset{language=c,breaklines=true,tabsize=3,showspaces=false,showstringspaces=false,basicstyle=\scriptsize\ttfamily,float=tbpH,frame=single,keywordstyle=\color{blue},commentstyle=\color{dkgreen}}
\hypersetup{colorlinks=true,urlcolor=blue,linkcolor=black}
\setlength{\parskip}{2ex}
\setlength{\parindent}{0pt}
\titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{0pt}{30pt}


\newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}}
\newcommand{\subscript}[1]{\ensuremath{_{\textrm{#1}}}}